#ifdef __cplusplus
extern "C" {
#endif


#ifndef LOGSYS_H
#define LOGSYS_H
#include "common.h"
#include <time.h>

typedef enum{
	USER_CANCEL,
	WORK_FINISHED,
	SYS_ERROR,
}END_TYPE;

typedef struct{
	float temper;
	float humi;
}Log_Data;

typedef struct{
	int year;
	int month;
	int day;
	int hour;
	int mins;
}Date;

typedef struct{
	Date start_time;
	Date end_time;
	END_TYPE end_type;
	U64 datacount;
	Log_Data setting_data;
	U64 worktime;
	char ver[8];
}Log_Head;

extern void Api_Logsys_Init();
extern void Api_Logsys_Uninit();

extern void Api_Logsys_StartLog(Log_Data setting_data,U64 worktime);
extern void Api_Logsys_AddData(Log_Data data);
extern void Api_Logsys_EndLog(END_TYPE type);

extern int Api_Logsys_ReadLog(char *file,Log_Head *head);
extern int Api_Logsys_ReadData(char *file,U64 pos,Log_Data *data);

#endif

#ifdef __cplusplus
}
#endif

